/**
 * MineAdmin is committed to providing solutions for quickly building web applications
 * Please view the LICENSE file that was distributed with this source code,
 * For the full copyright and license information.
 * Thank you very much for using MineAdmin.
 *
 * @Author X.Mo<root@imoi.cn>
 * @Link   https://github.com/mineadmin
 */

import type { MaSearchItem } from "@mineadmin/search";
import MaDictSelect from "@/components/ma-dict-picker/ma-dict-select.vue";
import MaDictRadio from "@/components/ma-dict-picker/ma-dict-radio.vue";

export default function getSearchItems(t: any): MaSearchItem[] {
  return [
    // {
    //   label: t("commerce_address.fields.user_id"),
    //   prop: "user_id",
    //   render: () => MaDictSelect,
    //   renderProps: { multiple: false },
    // },
    {
      label: t("commerce_address.fields.name"),
      prop: "name",
      render: "input",
      renderProps: { placeholder: t("commerce_address.placeholders.name") },
    },
    {
      label: t("commerce_address.fields.phone"),
      prop: "phone",
      render: "input",
      renderProps: { placeholder: t("commerce_address.placeholders.phone") },
    },
    {
      label: t("commerce_address.fields.province"),
      prop: "province",
      render: "input",
      renderProps: { placeholder: t("commerce_address.placeholders.province") },
    },
    {
      label: t("commerce_address.fields.city"),
      prop: "city",
      render: "input",
      renderProps: { placeholder: t("commerce_address.placeholders.city") },
    },
    {
      label: t("commerce_address.fields.district"),
      prop: "district",
      render: "input",
      renderProps: { placeholder: t("commerce_address.placeholders.district") },
    },
    {
      label: t("commerce_address.fields.address"),
      prop: "address",
      render: "input",
      renderProps: { placeholder: t("commerce_address.placeholders.address") },
    },
    {
      label: t("commerce_address.fields.is_default"),
      prop: "is_default",
      render: () => MaDictRadio,
      renderProps: {
        placeholder: t("commerce_address.placeholders.is_default"),
        data: [
          { label: "是", value: 1, color: "primary" },
          { label: "否", value: 2, color: "danger" },
        ],
      },
    },
  ];
}
